home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
351-375
/
disk_362
/
puzz
/
source
/
message.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
901b
|
60 lines
/* Send messages to user either in Workbench or CLI.
Martin J. Round. 15-Oct-1989
Many thanks to Ali T. Ozer for his IFF2PCS program which this
routine is based on.
*/
extern int runningfromcli;
extern BPTR _Backstdout;
void print(char *s)
{
if (_Backstdout)
Write(_Backstdout, s, strlen(s));
}
int Min (int a, int b)
{
return ((a > b) ? b : a);
}
int Max (int a, int b)
{
return ((a > b) ? a : b);
}
void message (UBYTE *m)
{
static struct IntuiText negtxt =
{0,1,COMPLEMENT,4,4,NULL,(UBYTE *)" O.K.",NULL};
static struct IntuiText bodytxt =
{0,1,COMPLEMENT,10,6,NULL,NULL,NULL};
if (m)
{
if (runningfromcli)
{
print (m);
print ("\n");
}
else
{
bodytxt.IText = m;
WBenchToFront ();
AutoRequest
(
NULL,
&bodytxt,
NULL,
&negtxt,
0L,
0L,
(long)(Max(Min(strlen(m)*10+50,625),200)),
54L
);
}
}
}